# -*- coding:utf-8 -*-
from rest_framework import serializers

from Apps.System.models.role_menu import Menu


class MenuSer(serializers.ModelSerializer):
    class Meta:
        model = Menu
        # fields = "__all__"
        exclude = ["role"]


class getMenuTreeSer(serializers.ModelSerializer):
    class Meta:
        model = Menu
        fields = ["id", "menuType", "parentId", "name"]


class getMenuSidebarSer(serializers.ModelSerializer):
    class Meta:
        model = Menu
        fields = ["id", "menuType", "parentId", "name", "icon", "web_path", "perms"]


# 获取父级菜单
class ParentMenuSer(serializers.ModelSerializer):
    class Meta:
        model = Menu
        fields = ['id', 'name']
